Computer graphics systems are commonly employed for rendering graphical images. Conventional computer graphics systems commonly include a display device having a two-dimensional (2D) array of light emitting areas. The light emitting areas are usually referred to as “pixels,” which is an abbreviation for picture elements. Such a graphics system typically employs hardware, software, or both to generate a 2D array of values that determines the colors or shades of grey that are to be emitted from the corresponding pixels of the display.
Computer graphics systems are commonly employed for the display of three-dimensional (3D) objects. Typically, such a system generates on a 2D display what appears to a viewer to be a 3D object by generating 2D views of the 3D object that is modeled in the computer memory. The 2D view of a 3D object that is generated at a particular time usually depends at least on a spatial relationship between the 3D object and a viewer of the 3D object at the particular time. This spatial relationship may be referred to as the view or eye point direction. For example, a car is a 3D object having a front and a back. However, whether one can see the taillights will depend on the position from which one is viewing the car. A view direction that is directly in front of the car will not show the taillights (but may instead show the headlights), while a view direction that is directly behind the car will show the taillights.
The process by which a computer graphics system generates the values for a 2D view of a 3D object is commonly referred to as image rendering or scan conversion. The graphics system usually renders a 3D object by subdividing the 3D object into a set of polygons and individually rendering each of the polygons. The values for a polygon that are rendered for a particular view direction usually depend on the surface features of the polygon and the effects of the lighting on the polygon. The surface features often include details such as surface colors and surface structures. The effects of lighting usually depend on a spatial relationship between the polygon and one or more light sources. This spatial relationship may be referred to as the light source direction. For example, if there is only one light source, the side of the object closest to the light source will be illuminated while the side of the object furthest from the light source might be in shadow.
Typically, the evaluation of the effects of lighting on an individual pixel in a polygon for a particular view direction involves a number of 3D vector calculations. One of ordinary skill in the art will recognize that the standard Blinn/Phong lighting equation is commonly used in computer graphics for performing lighting calculations for graphical images. Lighting calculations based on the Blinn/Phong equation generally includes floating-point, square-root and divide operations when used with normalized vectors. Such calculations are usually time-consuming and expensive whether performed in hardware or software.
One conventional method for reducing such computational overhead is to evaluate the effects of lighting at just a few areas of a polygon, such as the vertices, and then to interpolate the results across the entire polygon. Examples include methods that are commonly referred to as flat shading and Gouraud shading. Such methods usually reduce the number of calculations that are performed during scan conversion and thereby increase rendering speed. Unfortunately, such methods also usually fail to render shading features that are smaller than the areas of individual polygons. If the polygons are relatively large, the view will be noticeably distorted.
One conventional method for rendering features that are smaller than the area of a polygon is to employ what is referred to as a texture map. In general, a texture refers to a graphics data structure that models the surface appearance of an object. A texture may represent the visual experience of many materials and substances (e.g., terrain, plants, minerals, fur, and skin). Textures may be created digitally by sampling a physical surface utilizing photographic techniques. Alternatively, textures may be created manually utilizing a suitable graphics design application. Texture mapping involves mapping the surface appearance to a graphical surface modeled by a 3D structure. A typical texture map is a table that contains a pattern of color values for a particular surface feature. For example, a wood grain surface feature may be rendered using a surface model and a texture map that holds a color pattern for wood grain.
Texture mapping may be utilized for any number of applications. For example, texture mapping may be utilized by an architectural software application to generate a realistic depiction of a building based upon blueprint designs. For instance, a stucco texture may be wrapped onto a building frame by the architectural software application. Texture mapping may be additionally used to create special effects for movies, video game animation, website wallpapers, and/or the like. Texture mapping is desirable for these applications because it facilitates the representation of an object with an appreciable amount of realism and detail. Moreover, texture mapping may impart 3D qualities to the computer-generated image.
Texture mapping algorithms involve wrapping a texture over the surface of a model. Specifically, a 3D model or data structure of an object is created. For example, FIG. 1A depicts exemplary object 101 in R3 (i.e., 3D real space). The surface of object 101 may be represented as a set of polygons (typically triangles) in 3D space. The polygons are represented by their various vertices. The vertices are defined by coordinates in R3. For example, vertex 102 is defined by (x1, Y1, z1) and vertex 103 is defined by (x2, Y2, Z2)
As described above, most computer displays are only capable of displaying a 2D view of such 3D object 101. Accordingly, a mapping function is utilized to map the coordinates in R3 to coordinates in R2 (i.e., 2D real space). Typically, the mapping occurs by defining a view angle. FIG. 1B depicts such a mapping from object 101 of FIG. 1A to object 104. Vertex 102 is mapped to vertex 105 where vertex 105 is defined by two coordinates (X3, y3). Likewise, vertex 103 is mapped to vertex 106 where vertex 106 is defined by two coordinates (x4, y4). The mapping function allows the data to be represented in a form that may be displayed on a 2D display, such as a computer display.
Concurrently with the mapping, a texture is applied within the confines of the polygons of object 104 to provide a realistic appearance. For example, texture 201 of FIG. 2 may be applied to the polygons of object 104 to create a stone-like appearance. Texture 201 is typically implemented as a matrix of red-green-blue (RGB) values. The RGB values are mapped utilizing a suitable mapping function to the interior of the polygons of object 104. The final graphical image appears to have texture 201 “wrapped” around object 104.
However, this approach is limited as the final graphical image, to an extent, appears flat. Specifically, the graphical image does not appreciably vary in response to a change in illumination direction. Since it does not appreciably change under these conditions, localized shading or occlusions are not evident. Moreover, interreflections due to surface irregularities are not perceived.
Bump mapping is one texture mapping technique that addresses these limitations. Bump mapping involves creating a bump map of displacement values. The displacement values are utilized to perturb the surface normal vector. The perturbed surface normal vector is utilized to render shading in accordance with the Blinn/Phong lighting equation.
Materials, such as those that may comprise the surface of an object, include reflectance properties that define how a source light applied to the material is reflected. Different materials, such as a metal material, wood material, or cloth material, may each have different reflectance properties. As those of ordinary skill in the art will appreciate, the reflectance properties of a surface can be characterized by a Bidirectional Reflectance Distribution Function (“BRDF”), which generally characterizes the color of a surface as a function of incident light and exitant view directions.
In general, BRDF is a function that defines the way a material behaves based on different light directions and different view directions. For example, for an object of a given material (e.g., wood, cloth, metal, etc.), a viewer's perception of the object from a given direction will typically change if the direction at which light is directed toward the surface of such object changes. That is, the material of an object reflects light differently depending on the direction at which the light is directed toward the object, and a viewer typically perceives the object differently depending on the view direction and the direction at which light is directed toward the object. As an example, suppose a viewer is viewing an automobile. The viewer's perception of the metallic surface of the automobile (e.g., the specific color, etc.) generally depends, at least in part, on the direction at which the viewer is viewing the automobile and the direction at which light is directed toward the automobile. For instance, from a given viewing direction, a viewer may have one perception of the automobile's metallic surface with light applied thereto from a first direction (e.g., from a common direction at which the viewer is viewing the automobile), and the viewer may have a different perception of the automobile's metallic surface with light applied thereto from a second direction (e.g., at an angle skewed from the viewer's viewing direction). More specifically, from the viewer's perspective, the light is reflected differently by the automobile's metallic surface when the light is directed toward such surface from different directions. Thus, BRDF provides a further graphical imaging function that may be utilized in generating quality/realistic graphical images.
Accordingly, to render realistic graphical images, it is often desirable to utilize a BRDF. Various techniques have been developed in the prior art for utilizing a BRDF in rendering computer generated graphical images. In general, representations of reflectance functions may be categorized as either 1) parameterized models for specific kinds of BRDFs or 2) general approximation techniques.
The most familiar specialized parametric representation is likely the Phong model, which was one of the first reflectance models developed. See B. -T. Phong. “Illumination for Computer Generated Pictures,” Comm. ACM, 18(6):311–317, June 1975. Ward has presented a more sophisticated model based on anisotropic Gaussian lobes fitted to various BRDFs. See G. Ward. “Measuring and Modeling Anisotropic Reflection,” in Proc. SIGGRAPH, pages 265–272, July 1992. Also, He et al. have derived a physical-based model that is based on Kirchhoff diffraction, which also takes wavelength into account. See X. He, K. Torrance, F. Sillion, and D. Greenberg. “A Comprehensive Physical Model for Light Reflection,” in Proc. SIGGRAPH, pages 175–186, July 1991. As a further example, of a specialized parametric representation, Poulin and Fournier have proposed a model based on self-shadowing of microcylinders. See P. Poulin and A. Fournier. “A Model for Anisotropic Reflection,” in Proc. SIGGRAPH, pages 273–282, August 1990.
In addition to the techniques categorized as specialized parametric representation, there are many known BRDF approximation techniques. For example, Schröder and Sweldens have represented BRDFs using spherical wavelets. See P. Schröder and W. Sweldens. “Spherical Wavelets: Efficiently Representing Functions on the Sphere,” in Proc. SIGGRAPH pages 161–172, August 1995. Koenderink et al. have expressed BRDFs in terms of an orthonormal basis using Zemike polynomials. See J. Koenderink, A. van Doom, and M. Stavridi. “Bidirectional Reflection Distribution Function Expressed in Terms of Surface Scattering Modes,” in European Conference on Computer Vision, pages 28–39, 1996. Lafortune et al. have used an approximation based on the summation of generalized Phong cosine lobes. See E. Lafortune, S. -C. Foo, K. Torrance, and D. Greenberg. “Non-linear Approximation of Reflectance Functions.” in Proc. SIGGRAPH, pages 117–126, August 1997. Additionally, Cabral et al. teach the use of spherical harmonics to represent BRDFs. See B. Cabral, N. Max, and R. Springmeyer. “Bidirectional Reflection Functions from Surface Bump Maps,” in Proc. SIGGRAPH, pages 273–281, July 1987. As a further example of a BRDF approximation technique, Fournier used a sum of separable functions for representing reflectance models. See A. Fournier. “Separating Reflection Functions for Linear Radiosity,” in Eurographics Rendering Workshop, pages 383–392, June 1995.
Existing techniques for rendering of BRDFs have typically been computationally inefficient, thereby resulting in relatively slow rendering of graphical images having reflectance properties. Although, Heidrich and Seidel have proposed a single pass rendering algorithm using texture mapping. See W. Heidrich and H. -P. Seidel. “Efficient Rendering of Anisotropic Surfaces Using Computer Graphics Hardware,” in Image and Multi-dimensional DSP Wordshop (IMDSP), 1998. Additionally, Kautz and McCool have taught an interactive rendering technique with arbitrary BRDFs. See J. Kautz and D. McCool. “Interactive Rendering with Arbitrary BRDFs using Separable Approximations,” in Eurographics Rendering Workshop, 1999, the disclosure of which is hereby incorporated herein by reference. As used herein, “interactive rendering” and “real-time rendering” are synonymous, and both terms refer to a performance metric in terms of frames per second. Interactive rendering implies that the user can interact with the rendering. The opposite (i.e., non-real-time or non-interactive rendering) would be software rendering wherein performance is measured in terms of seconds per frame. With non-interactive rendering, frames are rendered ahead of time in a static order, and the frames are then played back in sequence without the ability to alter the order.